@extends('layouts.master')

@section('title')
    木业资讯——木投网商城管理后台
    @stop

@section('app_css')
    <link href="/resource/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="/resource/css/style.css">
    <link rel="stylesheet" href="/resource/css/dataTables.bootstrap.css">
    <link rel="stylesheet" href="/resource/css/fileinput.min.css">
@stop

@section('app_js')
    <script src="/resource/js/jquery-1.11.3.min.js"></script>
    <script src="/resource/js/bootstrap.min.js"></script>
    <script src="/resource/js/jquery.dataTables.min.js"></script>
    <script src="/resource/js/dataTables.bootstrap.min.js"></script>
    <script src="/resource/js/jquery.twbsPagination.js"></script>
    <script src="/resource/js/bootstrap-datetimepicker.min.js"></script>
    <script>
        /*date*/
        $('.form_datetime').datetimepicker({
            //language:  'fr',
            weekStart: 1,
            todayBtn:  1,
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            forceParse: 0,
            showMeridian: 1
        });
        /*全选*/
        $(function () {
            $("#all").click(function () {
                var checked_status = this.checked;
                $("input[name=demo]").each(function () {
                    this.checked = checked_status;
                });
            });
        });
        $(document).ready( function () {
            $('#example').DataTable({
                searching: false,
                info:false,
                pagingType:'full_numbers',
                lengthChange: false,
                language:{
                    oPaginate: {
                        sFirst: "首页",
                        sPrevious: "上页",
                        sNext: "下页",
                        sLast: "末页"
                    },
                }

            });
        });
    </script>
    @stop


@section('content')
    @include('common.nav')
<div class="container-fluid">
    <div class="row" id="navLeft">
        <div class="col-lg-2">
            <ul class="nav nav-pills nav-stacked">
                <li role="presentation" class="active"><a href="/show_information">资讯</a></li>
            </ul>
        </div>
        <div class="col-lg-10">
            <div class="navbottom">
              <span>您的位置：</span>资讯 > 资讯列表
            </div>
            <div class="contentNav">
              <ul>
                <li>资讯</li>
                <li class="btn btn-default active"><a href="/show_information">列表</a></li>
                <li class="btn btn-default"><a href="/add_information">新增</a></li>
              </ul>
            </div>
            <hr>
            <div class="contentMember">
              <form class="form-inline">
                <div class="form-group">
                  <label>资讯标题</label>
                  <input type="text" class="form-control" placeholder="">
                </div>
                <div class="form-group">
                  <label>来源</label>
                  <input type="text" class="form-control" placeholder="">
                </div>
                <div class="form-group">
                  <label>资讯分类</label>
                  <select class="form-control">
                    <option>请选择...</option>
                    <option></option>
                    <option></option>
                    <option></option>
                    <option></option>
                  </select>
                </div>
                <div class="form-group">
                  <label>发表时间</label>
                  <div class="input-group date form_datetime col-md-5" data-date="1979-09-16T05:25:07Z" data-date-format="dd MM yyyy - HH:ii p" data-link-field="dtp_input1">
                      <input class="form-control" size="16" type="text" value="" readonly>
                      <span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
                  </div>
                </div>
                <div class="form-group">
                  <label>~</label>
                  <div class="input-group date form_datetime col-md-5" data-date="1979-09-16T05:25:07Z" data-date-format="dd MM yyyy - HH:ii p" data-link-field="dtp_input1">
                      <input class="form-control" size="16" type="text" value="" readonly>
                      <span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
                  </div>
                </div>
                <button type="submit" class="btn btn-default">搜索</button>
              </form>
              <hr>
              <table class="table table-striped table-bordered bootstrap-datatable datatable table-hover" id="example">
                <thead>
                  <tr>
                    <th></th>
                    <th>资讯标题</th>
                    <th>资讯分类</th>
                    <th>来源</th>
                    <th>关键词</th>
                    <th>发表日期</th>
                    <th>操作</th>
                  </tr>
                </thead>
                <tbody>
                @foreach($information as $k => $info)
                  <tr>
                    <td><input type="checkbox" name="demo"></td>
                    <td>{{ $info->title }}</td>
                    <td>{{ $info->cate }}</td>
                    <td>{{ $info->source }}</td>
                    <td>{{ $info->keywords }}</td>
                    <td>{{ $info->created }}</td>
                    <td><a href="/edit_information?zx_id={{ $info->zx_id }}">编辑</a> | <a href="/delete_information?zx_id={{ $info->zx_id }}">删除</a></td>
                  </tr>
                    @endforeach
                </tbody>
              </table>
            </div>
            {{ $information->links() }}
        </div>
    </div>
</div>
@stop
